home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Presentations / Presentations ’92 / PatchWorks Kit / <PatchWorks++> / Storage.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-21  |  494 b   |  23 lines  |  [TEXT/MPS ]

  1. /*
  2.     Storage.h
  3.     
  4.     PC relative storage for MPW code resources.
  5.     
  6.     by Patrick C. Beard.
  7.     
  8.     Usage:
  9.         Store(void* p) stuffs a pointer pc-relative.
  10.         void* Retrieve() returns a previously stored value.
  11.         void** Storage() provides direct access.
  12.  */
  13.  
  14. #ifndef __STORAGE__
  15. #define __STORAGE__
  16.  
  17. void** __location() = { 0x6104, 0x0000, 0x0000, 0x201F };
  18. static void** Storage() { return __location(); }
  19. inline void Store(void* p) { *Storage() = p; }
  20. inline void* Retrieve() { return *Storage(); }
  21.  
  22. #endif
  23.